package com.heima.apis.article;

import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmFindNewsCommentsDto;
import com.heima.model.wemedia.dtos.WmNewsPageDto;
import com.heima.model.wemedia.dtos.WmUpdateCommentStatusDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

@FeignClient(name = "leadnews-article", contextId = "findAllNewsClient")
public interface ArticleClient {

    //图文统计 分页查询
    @PostMapping("/api/v1/article/newPage")
    PageResponseResult newPage(@RequestBody WmNewsPageDto dto);


    //图文数据统计
    @GetMapping("/api/v1/article/newsDimension")
    public ResponseResult newsDimension(@RequestParam("beginDate") Date beginDate, @RequestParam("endDate") Date endDate);


    //查看评论列表
    @PostMapping("/api/v1/article/findNewsComments")
    public PageResponseResult findNewsComments(@RequestBody WmFindNewsCommentsDto dto);

    //打开和关闭评论
    @PostMapping("/api/v1/article/updateCommentStatus")
    public ResponseResult updateStatus(@RequestBody WmUpdateCommentStatusDto dto);

}
